<?

class JCAT_JS
	extends JCAT_HTMLResourceBase
{
	/**
	 *
	 * @access	public
	 * @param	$sUrl		string
	 * @param 	$bDefer		bool
	 * @return	string
	 */
	public function JCAT_JS($sUrl,$sScript='JavaScript',$bDefer=false)
	{
		$this->JCAT_HTMLResourceBase($sUrl) ;
		$this->bDefer = $bDefer? true: false ;
		$this->sScript = $sScript ;
	}
	
	/**
	 * 编译 HTML 引用代码
	 *
	 * @access	public
	 * @return	string
	 */
	public function MakeHTMLAccessCode()
	{
		$sDefer = $this->bDefer? 'defer': '' ;
		return "<script language=\"{$this->sScript}\" {$sDefer} src=\"".$this->GetAccessUrl()."\"></script>" ;
	}
		
	/**
	 * 延迟加载
	 * 
	 * @access	private
	 * @var		bool
	 */
	private $bDefer = false ; 
	
	private $sScript ;
}

?>